package com.qf.hello.mybatis.dao;

import com.qf.hello.mybatis.entity.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface UserMapper {

    //添加员工
    int insertUser(User user);
    //添加员工后回主键ID,在员工对象中就可以获取到新增的id值了
    int insertUserWithId(User user);
    //根据ID删除员工
    int deleteUserById(Integer id);
    //根据ID修改员工
    int updateUser(User user);
    //根据ID查询用户
    User selectUserById(Integer id);
    //根据名字和密码查询用户
    User selectUserByNameAndPwd(@Param("name") String name, @Param("password") String pwd);
    //传递map参数
    User selectUserByNameAndPwdWithMap(Map<String,String> map);
    //传递user类型的参数
    User selectUserByNameAndPwdWithUser(User user);
    //动态查询 根据name或password查询用户
    List<User> selectUserByNameOrPwd(@Param("name") String name, @Param("password") String password);
    //模糊查询
    User selectUserByName(String name);
    //查询所有
    List<User> selectAll();
}
